<template>
  <div>
    <a-table
      :columns="columns"
      :data-source="oneOrderTable"
      :pagination="false"
    >
      <!-- 结算时间-->
      <span slot="receiveData" slot-scope="text, record">
        {{
          record.receiveData === null || record.receiveData === ""
            ? "暂无"
            : record.receiveData.replace("T", " ")
        }}
      </span>
      <!-- 接收时间-->
      <span slot="cost" slot-scope="text, record">
        {{ record.cost }}
      </span>
      <!-- 状态-->
      <span slot="state" slot-scope="text, record">
        <span style="color: #3eae7c">
          {{ record.state }}
        </span>
      </span>
      <span slot="clearingTime" slot-scope="text, record">
        {{
          record.clearingTime === null || record.clearingTime === ""
            ? "暂无"
            : record.clearingTime.replace("T", " ")
        }}
      </span>
    </a-table>
  </div>
</template>

<script>
export default {
  props: ["oneOrderTable"],
  data() {
    return {
      port: sessionStorage.getItem("terminal"),
    };
  },
  methods: {},
  computed: {
    columns() {
      if (this.port === "1") {
        return [
          {
            title: "入库仓库",
            dataIndex: "warehousingName",
            align: "center",
            scopedSlots: { customRender: "warehousingName" },
            width: "10%",

            //  fixed: "left",
          },
          {
            title: "订单编号",
            dataIndex: "ordeCode",
            align: "center",
            scopedSlots: { customRender: "ordeCode" },
            width: "9%",
          },
          {
            title: "客户编号",
            dataIndex: "tenantId",
            align: "center",
            width: "9%",
          },
          {
            title: "SKU数量（个）",
            dataIndex: "skuCount",
            // ellipsis: true,
            scopedSlots: { customRender: "skuCount" },
            align: "center",
            width: "9%",
          },
          // {
          //   title: "SKU总重量（g）",
          //   dataIndex: "typeName",
          //   scopedSlots: { customRender: "typeName" },
          //   align: "center",
          //   width: "10%",
          //   // ellipsis: true,
          // },
          {
            title: "币种",
            dataIndex: "currency",
            scopedSlots: { customRender: "currency" },
            align: "center",
            width: "8%",
            // ellipsis: true,
          },
          {
            title: "费用",
            dataIndex: "cost",
            scopedSlots: { customRender: "cost" },
            align: "center",
            width: "9%",
          },
          {
            title: "接收时间",
            dataIndex: "receiveData",
            scopedSlots: { customRender: "receiveData" },
            align: "center",
            width: "9%",
          },
          {
            title: "结算时间 ",
            dataIndex: "clearingTime",
            align: "center",
            width: "9%",
            scopedSlots: { customRender: "clearingTime" },
            // ellipsis: true,
          },
        ];
      } else {
        return [
          {
            title: "入库仓库",
            dataIndex: "warehousingName",
            align: "center",
            scopedSlots: { customRender: "warehousingName" },
            width: "10%",

            //  fixed: "left",
          },
          {
            title: "订单编号",
            dataIndex: "ordeCode",
            align: "center",
            scopedSlots: { customRender: "ordeCode" },
            width: "9%",
          },

          {
            title: "SKU数量（个）",
            dataIndex: "skuCount",
            // ellipsis: true,
            scopedSlots: { customRender: "skuCount" },
            align: "center",
            width: "9%",
          },
          // {
          //   title: "SKU总重量（g）",
          //   dataIndex: "typeName",
          //   scopedSlots: { customRender: "typeName" },
          //   align: "center",
          //   width: "10%",
          //   // ellipsis: true,
          // },
          {
            title: "币种",
            dataIndex: "currency",
            scopedSlots: { customRender: "currency" },
            align: "center",
            width: "8%",
            // ellipsis: true,
          },
          {
            title: "费用",
            dataIndex: "cost",
            scopedSlots: { customRender: "cost" },
            align: "center",
            width: "9%",
          },
          {
            title: "接收时间",
            dataIndex: "receiveData",
            scopedSlots: { customRender: "receiveData" },
            align: "center",
            width: "9%",
          },
          {
            title: "结算时间 ",
            dataIndex: "clearingTime",
            align: "center",
            width: "9%",
            scopedSlots: { customRender: "clearingTime" },
            // ellipsis: true,
          },
        ];
      }
    },
  },
};
</script>

<style lang="less" scoped>
</style>